Skip to content

[codex] Refactor review and text generation services#3196

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-server-review-text
Jun 20, 2026
Merged

[codex] Refactor review and text generation services#3196
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-server-review-text

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Defines the ReviewService and TextGeneration service contracts inline on their Context.Service tags.
  • Exposes canonical make and layer exports without synthetic Effect.succeed wrappers.
  • Updates provider-specific text-generation implementations and direct consumers to use namespace imports, module-qualified tags/helpers/errors, and Service["Service"] types.
  • Preserves the plain promise-based TextGenerationService provider contract.
  • Keeps the deprecated TextGenerationShape alias only for the excluded orchestration compatibility harness; this PR does not modify orchestration modules.

Behavior

Provider-instance routing, review diff generation, and text-generation behavior are unchanged. This is a service-module organization and typing refactor.

Validation

  • Eight review/text-generation test files — 53 tests passed
  • vp check — passed; 20 pre-existing unrelated warnings
  • vp run typecheck — passed
  • Review-thread audit — no unresolved or actionable inline threads
  • Orchestration/MCP diff audit — no changes

Note

Low Risk
Import and typing refactors only; provider-instance routing and service behavior are unchanged, with broad test coverage noted in the PR.

Overview
This PR mechanically aligns the review and text-generation domains with the repo’s target Effect Context.Service pattern without changing routing or generation behavior.

TextGeneration now defines its API on the service tag itself (replacing a separate TextGenerationShape interface), builds registry-backed implementations via TextGeneration.of, and exposes a make effect plus a layer wired as Layer.effect(TextGeneration, make). A deprecated TextGenerationShape alias remains for legacy consumers. ReviewService follows the same move: the standalone shape type is removed, make is a plain Effect.gen, and the layer references that effect directly.

All provider implementations (Claude, Codex, Cursor, Grok, OpenCode) and ProviderDriver now satisfy TextGeneration.TextGeneration["Service"] instead of the old shape type. Tests and harnesses (GitManager, ProviderAdapterRegistry, text-generation tests, etc.) switch to namespace imports (* as Module) for services, config, GitHub CLI, and related helpers so tokens and errors are referenced in a consistent, module-qualified way.

Reviewed by Cursor Bugbot for commit 7fe6a2e. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Refactor text generation and review services to use namespace imports

  • Replaces named imports with namespace imports across all text generation providers (ClaudeTextGeneration, CodexTextGeneration, CursorTextGeneration, GrokTextGeneration, OpenCodeTextGeneration) and the ReviewService, aligning import style with Effect.js conventions.
  • Replaces the separate TextGenerationShape interface with an inline Context.Service-based TextGeneration class; exports TextGenerationShape as a deprecated type alias for backward compatibility.
  • Adds a standalone make effect to TextGeneration.ts and simplifies the layer to Layer.effect(TextGeneration, make).
  • Updates ReviewService to inline its service shape via Context.Service generic and changes make from a function returning an Effect to a plain Effect.
  • Updates all test helpers and DI wiring in GitManager.test.ts and ProviderAdapterRegistry.test.ts to use namespaced service tokens (e.g. ServerConfig.ServerConfig.layerTest).

Macroscope summarized 7fe6a2e.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 55b18efe-0143-414e-a719-797dbc348164

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/effect-service-server-review-text

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: 92eee17a1337fb6a188937c323e76dae2c386585
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: eb448c5d21d67cc2c283172b1ea3495232588935
Update Details Update Permalink
DetailsBranch: pr-3196
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: 56de00b8ec482bdc5224f7f4526b3c919da075d2
Update Permalink
DetailsBranch: pr-3196
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: 56de00b8ec482bdc5224f7f4526b3c919da075d2
Update QR

@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

This PR contains mechanical refactoring changes - converting named imports to namespace imports and reorganizing type definitions. No runtime behavior is modified; the actual function implementations remain identical.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-review-text branch from 349a8f2 to 3d81b95 Compare June 20, 2026 02:34
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 02:34

Dismissing prior approval to re-evaluate 3d81b95

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-review-text branch from 3d81b95 to 874c228 Compare June 20, 2026 03:10
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:10

Dismissing prior approval to re-evaluate 874c228

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-review-text branch from 874c228 to 7fe6a2e Compare June 20, 2026 03:17
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:18

Dismissing prior approval to re-evaluate 7fe6a2e

@juliusmarminge juliusmarminge merged commit b630278 into main Jun 20, 2026
15 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-service-server-review-text branch June 20, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant